package com.jacars.biz.user.dao.service.impl;

import com.jacars.biz.user.dao.mapper.JsptUserRoleMapper;
import com.jacars.biz.user.dao.model.JsptRoleUser;
import com.jacars.biz.user.dao.service.JsptRoleUserService;
import com.jacars.common.model.JsptRole;
import com.jacars.common.service.impl.SuperServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zlt
 */
@Slf4j
@Service
public class JsptRoleUserServiceImpl extends SuperServiceImpl<JsptUserRoleMapper, JsptRoleUser> implements JsptRoleUserService {
    @Resource
    private JsptUserRoleMapper jsptUserRoleMapper;

    @Override
    public int deleteUserRole(Long userId, Long roleId) {
        return jsptUserRoleMapper.deleteUserRole(userId, roleId);
    }

    @Override
    public int saveUserRoles(Long userId, Long roleId) {
        return jsptUserRoleMapper.saveUserRoles(userId, roleId);
    }

    @Override
    public List<JsptRole> findRolesByUserId(Long userId) {
        return jsptUserRoleMapper.findRolesByUserId(userId);
    }

    @Override
    public List<JsptRole> findRolesByUserIds(List<Long> userIds) {
        return jsptUserRoleMapper.findRolesByUserIds(userIds);
    }
}
